package com.mcc.app.common.impl;

import com.mcc.app.cache.domain.HisCol;
import com.mcc.app.cache.domain.PlcCache;
import com.mcc.app.cache.service.IPlcCacheService;
import com.mcc.app.common.IAgentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class AgentServiceImpl implements IAgentService {

    @Autowired
    private IPlcCacheService plcCacheService;

    @Override
    public List<HisCol> getHisColListByCode(PlcCache plcCache, Date startDt, Date endDt, Integer timeTag) {
        return plcCacheService.getHisColListByCode(plcCache, startDt, endDt, timeTag);
    }

    @Override
    public List<HisCol> getHisColListByCode(PlcCache plcCache, Date startDt, Date endDt, Integer timeTag, int hour,int minute, int sec){
        return plcCacheService.getHisColListByCode(plcCache, startDt, endDt, timeTag,hour,minute,sec);
    }

    @Override
    public List<HisCol> getHisColListByCode(PlcCache plcCache, Date startDt, Date endDt, Integer timeTag, int topNum, String order){
        return plcCacheService.getHisColListByCode(plcCache, startDt, endDt, timeTag,topNum, order);
    }

    @Override
    public List<HisCol> getHisStatusListByCode(String code, Date startDt, Date endDt) {
        return plcCacheService.getHisStatusListByCode(code, startDt, endDt);
    }

    @Override
    public Map<String, Object> getHisTable(List<PlcCache> cacheList, String tableTag, Integer timeTag, Date startDt, Date endDt, Integer pageNum, Integer pageSize) {
        return plcCacheService.getHisTable(cacheList, tableTag, timeTag, startDt, endDt, pageNum, pageSize);
    }
}
